# -  *  - coding:utf-8  -  *  -
import xlrd

from config.globalconfig import test_data_path


class Data(object):

    def __init__(self, filename=test_data_path, sheetname="loginelement.xlsx"):
        try:
            self.workBook = xlrd.open_workbook(filename)
            self.sheetName = self.workBook.sheet_by_name(sheetname)
        except Exception as e:
            raise e

    def readExcel(self, row, col):
        try:
            value = self.sheetName.cell(col, row).value
        except Exception as e:
            raise e
        return value